Skip to content

Conversation

@devversion
Copy link
Member

@devversion devversion commented Mar 18, 2025

See individual commits

@devversion devversion changed the title Rjs 2 Second iteration of rules_js migration Mar 18, 2025
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Mar 18, 2025
@devversion devversion force-pushed the rjs-2 branch 5 times, most recently from 0496438 to 4d7bd95 Compare March 19, 2025 14:01
For linking of Angular packages we are using something more clever than
what we are doing with `rules_nodejs`. Instead of maintaing complexity
where we pre-link FESM bundles and somehow inject them into other Bazel
bundling steps (with complex linker mappings), we pre-link as part of
individual package postinstall steps, exposing the linked bundles via a
NodeJS exports condition.

This is possible vis this package/script:
https://github.com/devversion/angular-linking

Clearly this is not at a good location, but it's necessary right now to
ship this code via npm because `rules_js` struggles to use pnpm
extensions onto workspace 1st-party packages. Long-term we can either
decide to keep it that way, move it into e.g. dev-infra repository, or
we can explore shipping pre-linked bundles via APF. TBD.
@devversion devversion added the target: patch This PR is targeted for the next patch release label Mar 19, 2025
@devversion devversion marked this pull request as ready for review March 19, 2025 15:49
@devversion devversion requested review from a team as code owners March 19, 2025 15:49
@devversion devversion requested review from andrewseguin and wagnermaciel and removed request for a team March 19, 2025 15:49
Migrates all `ts_library` targets in `tools/` to use the `rules_js`
`ts_project` rule.
Improves the `ts_project` interop to work with Esbuild bundling. Right
now we can end up with multiple copies of the same source file.

e.g. input might import from `@angular/cdk/testing` and end up with
the version of `rules_nodejs` linker, while other imports to the native
`ts_library` targets end up being mapped to their actual sources in the
`bazel-bin`, and not inside `node_modules`
Migrates more `ts_library` targets to `rules_js`
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devversion devversion merged commit 1c223d9 into angular:main Mar 19, 2025
19 checks passed
@devversion devversion deleted the rjs-2 branch March 19, 2025 16:30
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: build & ci Related the build and CI infrastructure of the project target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants